laravel array cache

34

$value = "foo"; // dynamic string value

if(Cache::has('key')){
  $newValue = Cache::get('key');
  $newValue[] = $value;
  Cache::put('key', $newValue);
}else{
  Cache::put('key', Arr::wrap($value));
}

Comments

Submit
0 Comments